<?php
/**
 * Included version of GotStudentActivity for Contact form
 * @package ModuleGestionUniversitaire
 * @version 1.0b
 * @return table
 */

$gotstudentactivityList = $contact->GetGotstudentactivityList();
if (count($gotstudentactivityList) > 0):
?>
<table cellpadding="0" cellspacing="0" border="0" class="table-objects corner-all">
	<tr>
		<th class="check"></th>
		<th>Poste</th>
		<th>Société</th>
		<th>De</th>
		<th>À</th>
	</tr>
	<?php foreach ($gotstudentactivityList as $gotstudentactivity) {
		$studentactivity = $gotstudentactivity->GetStudentActivity();
		$company = $gotstudentactivity->GetCompany();
		$dateFrom = explode('-', $gotstudentactivity->from);
		$dateFrom = $dateFrom[2].'/'.$dateFrom[1].'/'.$dateFrom[0];
		$dateTo = explode('-', $gotstudentactivity->to);
		$dateTo = $dateTo[2].'/'.$dateTo[1].'/'.$dateTo[0];
		
		$res  = '<tr>';
		$res .= '<td class="check"><input type="checkbox" value="'.$gotstudentactivity->gotstudentactivityId.'" /></td>';
		$res .= '<td>'.$studentactivity->name.'</td>';
		$res .= '<td><a href="companies.php?id='.$company->companyId.'&operation=edit">'.$company->name.'</a></td>';
		$res .= '<td>'.$dateFrom.'</td>';
		$res .= '<td>'.$dateTo.'</td>';
		$res .= '</tr>';
		echo $res;
	} ?>
</table>
<?php endif; ?>
<br />
<a href="#" id="details-studentactivity" class="nav">Editer</a>
<a href="gotstudentactivities.php?operation=add&cid=<?php echo $contact->contactId; ?>" class="nav">Nouveau</a>
<a href="#" id="delete-studentactivity" class="nav">Supprimer</a>
<a href="#" id="merge-prorole" class="merge">Fusionner</a>

<a href="#" class="selectall">Tout cocher</a>
<a href="#" class="selectnone">Tout décocher</a>